package config

//go:generate vc
type Config struct {
	Dialect struct {
		Io   string
		Repo string
	}
	Io struct {
		Http struct {
			Gin struct {
				Port    int    `default:"8080"`
				GinMode string `default:"test"`
			}
		}
		Websocket struct {
			MsgType int    // 0 text 1 binary
			Url     string `default:"websocket"`
		}
		Rpc struct {
			ServerName string
		}
	}
	Repo struct {
		Clear bool `default:"false"` // 是否清理数据库中数据
		Sql   struct {
			Sqlx struct {
				Driver string `default:"sqlite3"`
				Mysql  struct {
					User     string
					Password string
					Host     string
					Port     int
					Db       string `default:"clean"`
					Timeout  int    `default:"10"`
					MaxOpen  int    `default:"150"`
					MaxIdle  int    `default:"15"`
				}
				Sqlite3 struct {
					Dir string
					Db  string `default:":memory:"`
				}
			}
			Gorm struct{
				Driver string `default:"sqlite3"`
				Mysql  struct {
					User     string
					Password string
					Host     string
					Port     int
					Db       string `default:"clean"`
					Timeout  int    `default:"10"`
					MaxOpen  int    `default:"150"`
					MaxIdle  int    `default:"15"`
				}
				Sqlite3 struct {
					Dir string
					Db  string `default:":memory:"`
				}
			}
		}
		Mongo struct {
		}
		Kv struct {
		}
	}
}
